package org.example.design.singleton;

/**
 * @Classname Singleton_01
 * @Description TODO
 * @Date 2020/11/3 10:02 上午
 * @Created by xiangjd
 */
public class Singleton_01 {

    private static volatile Singleton_01 instance;

    private Singleton_01() {

    }

    public static synchronized Singleton_01 getInstance() {
        if (instance == null) {
            synchronized (Singleton_01.class) {
                if (instance == null) {
                    instance = new Singleton_01();
                }
            }
        }
        return instance;
    }
}
